import request from '@/utils/request'

// 加入购物车
// goodsId=>商品id iphone8
// goodsSkuId=>商品规格id 红色的iphone8粉色的iphone8
export const addCart = (goodsId, goodsNum) => {
  return request.post('/cart/add', {
    goodsId,
    goodsNum
  })
}

// 获取购物车列表
export const getCartList = () => {
  return request.get('/cart/getCartList')
}

// 更新购物车商品数量
export const changeCount = (goodsId, goodsNum) => {
  return request.post('/cart/update', {
    goodsId,
    goodsNum
  })
}

// 删除购物车
export const delSelect = (cartIds) => {
  return request.post('/cart/delete', {
    cartIds
  })
}
